package com.github.chirspan.xaas.rbac.model;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.chirspan.xaas.mybatis.model.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.util.Date;

/**
 * @author chenpan
 * @ClassName: SysUser
 * description:
 * @date 2018-04-02 14:05
 */
@TableName(value = "xaas_rbac_user")
@Data
@ToString(callSuper = true)
@ApiModel(value = "RbacUser", description = "用户信息")
public class RbacUser extends BaseModel {

    private static final long serialVersionUID = 6526179978095282388L;

    /**
     * 账户有效
     */
    public static final String STATUS_VALID = "1";
    /**
     * 账户锁定
     */
    public static final String STATUS_LOCK = "0";

    public static final String DEFAULT_THEME = "darkBlue";

    public static final String DEFAULT_AVATAR = "default.jpg";


    @ApiModelProperty("用户名")
    @TableField(value = "USERNAME")
    private String username;

    @ApiModelProperty("昵称/姓名")
    @TableField(value = "NICK_NAME")
    private String nickName;

    @ApiModelProperty("密码")
    @TableField(value = "PASSWORD")
    private String password;

    @ApiModelProperty("性别编码")
    @TableField(value = "GENDER_CODE")
    private String genderCode;

    @ApiModelProperty("性别名称")
    @TableField(value = "GENDER_NAME")
    private String genderName;

    @ApiModelProperty("邮箱")
    @TableField(value = "EMAIL")
    private String email;

    @ApiModelProperty("电话")
    @TableField(value = "PHONE")
    private String phone;

    @ApiModelProperty("IM")
    @TableField(value = "im")
    private String im;

    @ApiModelProperty("账号状态")
    @TableField(value = "STATUS")
    private String status;

    @ApiModelProperty("上次登录时间")
    @TableField(value = "LAST_LOGIN_TIME")
    private Date lastLoginTime;

    @ApiModelProperty("主题")
    @TableField(value = "THEME")
    private String theme;

    @ApiModelProperty("图像")
    @TableField(value = "AVATAR")
    private String avatar;

    @ApiModelProperty("备注")
    @TableField(value = "DESCRIPTION")
    private String description;

    @ApiModelProperty("人员ID")
    @TableField(value = "practitioner_id")
    private String practitionerId;

    @ApiModelProperty("扩展属性")
    @TableField(value = "extension")
    private String extension;

    @ApiModelProperty("角色")
    @TableField(exist = false)
    private String[] roles;

    @ApiModelProperty("科室")
    @TableField(exist = false)
    private String[] depts;

    @TableField(exist = false)
    private String rolesStr;

    @TableField(exist = false)
    private String deptsStr;

}
